{% extends 'base.html' %}
{% block title %}
    <title>订单结算</title>
{% endblock %}
{% block container %}
    <!--主体-->
    <header class="wy-header">
      <div class="wy-header-icon-back"><span></span></div>
      <div class="wy-header-title">订单详情</div>
    </header>
    <form class="weui-content" method="post"
    action="{% url 'mine:order_pay' %}">
        <input type="hidden" name="sn" value="{{ object.sn }}">
      <div class="wy-media-box weui-media-box_text address-select">
        <div class="weui-media-box_appmsg">
          <div class="weui-media-box__hd proinfo-txt-l" style="width:20px;">
            <span class="promotion-label-tit"
              ><img src="images/icon_nav_city.png"
            /></span>
          </div>
          <div class="weui-media-box__bd">
            <a href="{% url 'accounts:address_list' %}" class="weui-cell_access">
              <h4 class="address-name">
                <span>{{ object.to_user }}</span><span>{{ object.to_phone }}</span>
              </h4>
              <div class="address-txt">{{ object.to_area }}{{ object.to_address }}</div>
            </a>
          </div>
          <div class="weui-media-box__hd proinfo-txt-l" style="width:16px;">
            <div class="weui-cell_access">
              <span class="weui-cell__ft"></span>
            </div>
          </div>
        </div>
      </div>
      <div class="wy-media-box weui-media-box_text">
        <div class="weui-media-box__bd">
            {% for item in object.get_cart_product %}
                {% with product=item.product %}
          <div class="weui-media-box_appmsg ord-pro-list">
            <div class="weui-media-box__hd">
              <a href="{% url 'mall:product_detail' product.uid %}"
                ><img class="weui-media-box__thumb" src="{{ product.img.url }}" alt=""
              /></a>
            </div>
            <div class="weui-media-box__bd">
              <h1 class="weui-media-box__desc">
                <a href="{% url 'mall:product_detail' product.uid %}" class="ord-pro-link"
                  >{{ product.name }}</a
                >
              </h1>
              <p class="weui-media-box__desc">
                规格：<span>红色</span>，<span>23</span>
              </p>
              <div class="clear mg-t-10">
                <div class="wy-pro-pri fl">
                  ¥<em class="num font-15">{{ item.price }}</em>
                </div>
                <div class="pro-amount fr">
                  <span class="font-13">数量×<em class="name">{{ item.count }}</em></span>
                </div>
              </div>
            </div>
          </div>
                {% endwith %}
          {% endfor %}
        </div>
      </div>
      <div class="weui-panel">
        <div class="weui-panel__bd">
          <div class="weui-media-box weui-media-box_small-appmsg">
            <div class="weui-cells">
              <div class="weui-cell weui-cell_access">
                <div class="weui-cell__bd weui-cell_primary">
                  <p class="font-14">
                    <span class="mg-r-10">配送方式</span
                    ><span class="fr">快递</span>
                  </p>
                </div>
              </div>
              <div class="weui-cell weui-cell_access" href="javascript:;">
                <div class="weui-cell__bd weui-cell_primary">
                  <p class="font-14">
                    <span class="mg-r-10">运费</span
                    ><span class="fr txt-color-red"
                      >￥<em class="num">10.00</em></span
                    >
                  </p>
                </div>
              </div>
              <a class="weui-cell weui-cell_access" href="money.html">
                <div class="weui-cell__bd weui-cell_primary">
                  <p class="font-14">
                    <span class="mg-r-10">可用积分</span
                    ><span class="sitem-tip"><em class="num">{{ user.integral }}</em>分</span>
                  </p>
                </div>
                <span class="weui-cell__ft"></span>
              </a>
              <a class="weui-cell weui-cell_access" href="coupon.html">
                <div class="weui-cell__bd weui-cell_primary">
                  <p class="font-14">
                    <span class="mg-r-10">优惠券</span
                    ><span class="sitem-tip"><em class="num">0</em>张可用</span>
                  </p>
                </div>
                <span class="weui-cell__ft"></span>
              </a>
            </div>
          </div>
        </div>
      </div>
      <div class="wy-media-box weui-media-box_text">
        <div class="mg10-0 t-c">
          总金额：<span class="wy-pro-pri mg-tb-5"
            >¥<em class="num font-20">{{ object.buy_amount }}</em></span
          >
        </div>
          {% if object.status == contants.ORDER_STATUS_PAIED %}
              <div class="mg10-0">
                <div class="weui-btn weui-btn_primary">您已支付</div>
              </div>
          {% else %}
              <div class="mg10-0">
                <button class="weui-btn weui-btn_primary" type="submit">积分支付</button>
              </div>
          {% endif %}
      </div>
    </form>
{% endblock %}

{% block footer %}
    <script type="text/javascript" src="/static/js/jquery.Spinner.js"></script>
    <script type="text/javascript">
      $(function() {
        $('.Spinner').Spinner({ value: 1, len: 3, max: 999 });
      });
    </script>
    <script src="js/jquery-weui.js"></script>
{% endblock %}